from typing import Generic, TypeVar, List
from pydantic import BaseModel

ListItem = TypeVar('ListItem', bound=BaseModel)


class PageSchemas(Generic[ListItem]):

    page: int = 0
    limit: int = 0
    count: int = 0
    items: list = []

    def __init__(self, page: int, limit: int, count: int, items: List[ListItem]):
        self.page = page
        self.limit = limit
        self.count = count
        self.items = items
